package cn.yunhe.controller;

import cn.yunhe.po.User;
import cn.yunhe.service.UserService;

public class UserAction extends BaseAction{
	private String username;
	private String password;

	public String execute() {
		UserService userService = new UserService();
		User user = userService.login(username, password);
		if (user!=null) {
			getMapSession().put("username", user.getUserName());			
			return "success";
		} else {
			return "fail";
		}

	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
